using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LogParser.DA;
using LogParser.DA.DataObjects;

namespace ASP_TF2LogParser.UserControls
{
    public partial class LogFileListControl : System.Web.UI.UserControl
    {
        private LogParser.DA.LogFileModel _logModel;

        protected void Page_Load( object sender, EventArgs e )
        {
            _logModel = new LogFileModel();
        }



        public string GenerateUrl( string logName )
        {

            string returnUrl = "";

            int logId = _logModel.GetLogId( logName );

            if ( Request.Url.ToString().ToUpper().Contains( "ADMIN/DELETELOGFILE" ) )
            {
                returnUrl = "<a href='../Match.aspx?logId=" + logId + "'>" + logName + "</a>";
            }
            else
            {
                returnUrl = "<a href='Match.aspx?logId=" + logId + "'>" + logName + "</a>";
            }

            
            return returnUrl;


        }



    }
}